﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LearnCSharp_1
{
    class LearnException
    {
        private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
        public static void Main_LearnException(string[] args)
        {
            division(22, 0);
            Console.ReadKey();
        }

        public static void division(int num1, int num2)
        {
            int result = 0;
            try
            {
                result = num1 / num2;
            }
            catch (DivideByZeroException e)
            {
                logger.Error(e);
            }
            finally
            {
                logger.Info("Result: {0}", result);
            }
        }
    }
}
